package chapter4.No4_2_使用ReentrantReadWriteLock类.demo1;

/**
 * 类ReentrantReadWriteLock的使用：读读共享
 * Created by Administrator on 2016/11/24.
 */
public class Main {
    public static void main(String[] args) {
        final Service service = new Service();
        Runnable ar = new Runnable() {
            public void run() {
                service.read();
            }
        };

        Thread a = new Thread(ar);
        a.setName("a");

        Thread b = new Thread(ar);
        b.setName("b");

        a.start();
        b.start();
    }
}
